local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp = require('cmp')

require("nvim-autopairs").setup({
	map_c_h = true
})
-- If you want insert `(` after select function or method item
local handlers = require("nvim-autopairs.completion.handlers")
cmp.event:on(
	"confirm_done",
	cmp_autopairs.on_confirm_done({
		filetypes = {
			-- "*" is an alias to all filetypes
			["*"] = {
				["("] = {
					kind = {
						cmp.lsp.CompletionItemKind.Function,
						cmp.lsp.CompletionItemKind.Method,
					},
					handler = handlers["*"],
				},
			},
			-- Disable for tex
			tex = false,
		},
	})
)
